import React from 'react';
import MyTable from '@/components/MyTable/index'

const index = () => {

    const columns = [
        {
            title: '商品名称',
            dataIndex: 'goods_title',
            toggle: true
        },
        {
            title: '商品价格',
            dataIndex: 'goods_price',
        },
        {
            title: '秒杀价格',
            dataIndex: 'rush_price',
        },
        {
            title: '库存',
            dataIndex: 'stock'
        },
    ];


    const dataList = [
        {
            goods_title: "白星手办",
            goods_price: "100.00",
            rush_price: "90.00",
            stock: 5,
            childList: [
                {
                    sku_title: "小白星",
                    sku_price: "50.00"
                }
            ]
        },
        {
            goods_title: "路费手办",
            goods_price: "60.00",
            rush_price: "5.00",
            stock: 99,
            childList: [
                {
                    sku_title: "小路飞",
                    sku_price: "40.00"
                }
            ]
        }
    ];
    const childColumns = ['sku_title', 'sku_price']

    return (
        <div>

            <MyTable columns={columns} dataSource={dataList} childColumns={childColumns} />
        </div>
    );
};

export default index;